﻿using Bmz.Studio.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bmz.Studio.EntityFramework.Mapping
{
    public partial class ResumeMap:StudioEntityTypeConfiguration<Resume>
    {
        public ResumeMap()
        {
            this.HasKey(p=>p.Id);
            this.Property(p=>p.Name).HasMaxLength(50).IsRequired();
            this.Property(p=>p.Description).HasMaxLength(500).IsRequired();

            this.HasMany(p=>p.Skills)
                .WithRequired(p=>p.Resume)
                .HasForeignKey(p=>p.ResumeId)
                .WillCascadeOnDelete(true);
        }
    }
}
